package com.hex.ds.hdtp.core.app.script.test.dto.response;

import cn.hutool.core.util.StrUtil;
import lombok.Data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Package: com.hex.ds.hdtp.core.app.script.test.dto.response
 * @ClassName ScriptDataTestListResponseDto
 * @Description: 带数据测试脚本清单ResponseDto对象
 * @Author: wz.li
 * @Date 2023/8/1 15:21
 * @Version v2.0.2
 **/
@Data
public class ScriptDataTestListResponseDto {

    private String pkId;

    private String taskPkId;

    private String scriptConvertListPkId;

    private String scriptName;

    private String sourceTableNames;

    private String targetTableNames;

    private List<String> sourceTableNameList;

    private List<String> targetTableNameList;

    public List<String> getSourceTableNameList() {
        if (StrUtil.isNotBlank(sourceTableNames)){
           return Arrays.asList(StrUtil.split(sourceTableNames, ","));
        }
        return new ArrayList<>();
    }

    public List<String> getTargetTableNameList() {
        if (StrUtil.isNotBlank(targetTableNames)){
            return Arrays.asList(StrUtil.split(targetTableNames, ","));
        }
        return new ArrayList<>();
    }
}
